﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Universities._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div>
        <br />
        <br />
&nbsp;
        <table style="width: 100%;">
            <tr>
                <td>
                    &nbsp;
                <asp:Image ID="Image1" runat="server" ImageAlign="Middle" 
            ImageUrl="~/Pictures/Banner.png" Height="580px" Width="380px" />
                </td>
                <td valign="top">
                   <fieldset style="overflow: scroll; width: 500px; height: 580px">
                   <legend>Resent Posts</legend>
                   <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
                    <ItemTemplate>
                        <a class="__headerStyle" href="BlogDetails.aspx?ID=<%# Eval("ID")%>"><%# Eval("Tittle")%></a>
                        <hr />
                        <p style="text-align:right">posted By <%# Eval("UserName")%></p>
                        <p style="text-align:right">on <%# Eval("PostDate")%></p>
                    </ItemTemplate>
                    </asp:Repeater>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:UniConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:UniConnectionString.ProviderName %>" 
                        SelectCommand="SELECT TOP 5 * FROM [Qry_View_Blog_Articles] ORDER BY [ID] DESC">
                    </asp:SqlDataSource>
                   </fieldset>
                </td>
            </tr>
            <tr>
            <td class="style1" colspan="2">
            <fieldset>
                   <legend>Resent Photos Uploded</legend>
                   <asp:DataList ID="DataList1" runat="server" RepeatColumns="4" Width = "500px" 
                       DataSourceID="SqlDataSource2" DataKeyField="ID">
        <ItemTemplate>
            <br />
            <table cellpadding = "5px" cellspacing = "0">
            <tr>
                <td>
                   <a href='ImageZoom.aspx?GID=<%# Eval("ID")%>&UID=<%# Eval("UniversityID")%>' > <asp:Image ID ="Image1" runat="server" ImageUrl = '<%# Eval("Photos")%>' 
                    Width = "200px" Height = "200px"/></a>
                </td>
            </tr>
            </table>
            <br /> 
        </ItemTemplate> 
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UniConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:UniConnectionString.ProviderName %>" 
        SelectCommand="SELECT Top 4 * FROM [Gallery] ORDER BY [ID]">
    </asp:SqlDataSource>
                   </fieldset>
            </td>
            </tr>
            </table>
</div>
</asp:Content>
